package com.guoguo.api;

import com.alibaba.fastjson.JSONObject;
import com.guoguo.base.BaseController;
import com.guoguo.entity.Statistical;
import com.guoguo.entity.vo.RankingVO;
import com.guoguo.service.ICategoryService;
import com.guoguo.service.IStatisticalService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/8/31 0031.
 */

     /*
                           _ooOoo_
                          o8888888o
                          88" . "88
                          (| -_- |)
                          O\  =  /O
                       ____/`---'\____
                     .'  \\|     |//  `.
                    /  \\|||  :  |||//  \
                   /  _||||| -:- |||||-  \
                   |   | \\\  -  /// |   |
                   | \_|  ''\---/''  |   |
                   \  .-\__  `-`  ___/-. /
                 ___`. .'  /--.--\  `. . __
              ."" '<  `.___\_<|>_/___.'  >'"".
             | | :  `- \`.;`\ _ /`;.`/ - ` : | |
             \  \ `-.   \_ __\ /__ _/   .-` /  /
        ======`-.____`-.___\_____/___.-`____.-'======
                           `=---='
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 佛祖保佑       永无BUG
        */
@RestController
@RequestMapping("/api/ranking")
public class RankingController extends BaseController {
    @Resource
    private IStatisticalService iStatisticalService;

    /**
     * 排行榜
     *
     * @param rankType
     * @return
     */
    @RequestMapping(value = "/getRanking", method = RequestMethod.POST)
    public JSONObject getRankingList(@RequestParam int rankType) {
        List<RankingVO> rankingVOs = iStatisticalService.getRanking(rankType);
        return returnResult(200, rankingVOs, "");
    }
}
